home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d6 / xact.arc / X16SHARE.DOC < prev    next >
Text File  |  1991-04-28  |  78KB  |  2,162 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                  Shareware XACT-16C
  9.  
  10.  
  11.  
  12.  
  13.                            The Hewlett-Packard Compatible
  14.  
  15.                                Programmer's Calculator
  16.  
  17.                                     USER'S MANUAL
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                                 CalcTech Incorporated
  38.  
  39.                         13629 Bellevue-Redmond Rd., Suite 202
  40.  
  41.                                  Bellevue, WA. 98005
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.                           Sales, 9:00AM-5:00PM Pacific time
  50.                                     206-643-1682
  51.  
  52.                       Tech Support,Info Line,24 Hour Voice Mail
  53.                                     206-527-9950
  54.  
  55.  
  56.  
  57.                                 Description
  58.  
  59.  
  60.      This shareware version of XACT-16C is not a demo program!   It is
  61.      a  complete,  full featured Programmer's  Calculator  for  MS-DOS
  62.      computers,  equivalent to  the  Hewlett-Packard  HP-16C  handheld
  63.      calculator.
  64.  
  65.      Since  it  is  a  shareware  program,  you  may make  copies  and
  66.      distribute them to your friends and co-workers, on bulletin board
  67.      systems, and so on.  However, you may not modify this  program or
  68.      documentation in any  manner,  nor may you distribute the program
  69.      or documentation for profit (handling fees are OK).
  70.  
  71.  
  72.                              License Agreement
  73.  
  74.      THE SOFTWARE HEREIN ARE PROVIDED  "AS IS" WITHOUT WARRANTY OF ANY
  75.      KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  76.      THE IMPLIED  WARRANTIES  OF  MERCHANTABILITY  AND  FITNESS  FOR A
  77.      PARTICULAR PURPOSE.   THE  ENTIRE  RISK  AS  TO  THE  QUALITY AND
  78.      PERFORMANCE OF THE PROGRAMS IS WITH YOU.
  79.  
  80.      IN  NO  EVENT  SHALL CALCTECH OR ANY OF IT'S OFFICERS, DIRECTORS,
  81.      SHAREHOLDERS, EMPLOYEES,  AFFILIATES,  OWNERS,  OR  OTHER RELATED
  82.      PARTIES BE LIABLE  TO  YOU  OR  ANY OTHER THIRD PARTY FOR DAMAGES
  83.      INCLUDING ANY  LOST PROFITS, LOST SAVINGS, OR OTHER INCIDENTAL OR
  84.      CONSEQUENTIAL DAMAGES ARISING OUT OF  THE USE OF OR THE INABILITY
  85.      TO USE THIS PRODUCT OR AS TO THE PERFORMANCE OF THIS PRODUCT EVEN
  86.      IF WE HAVE  BEEN  ADVISED  OF  THE POSSIBILITY OF SUCH DAMAGES IN
  87.      ADVANCE.
  88.  
  89.      SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY
  90.      FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES SO  THE  ABOVE LIMITATION
  91.      OR EXCLUSION MAY NOT APPLY TO YOU.
  92.  
  93.      THIS  AGREEMENT  IS  GOVERNED  BY   THE  LAWS  OF  THE  STATE  OF
  94.      WASHINGTON.
  95.  
  96.  
  97.  
  98.                            Trademarks/Copyrights
  99.  
  100.      HP-11C, HP-12C, and HP-16C are trademarks of Hewlett-Packard
  101.      PC-DOS, IBM-PC, PC-XT, PC-AT and PS/2 are trademarks of IBM.
  102.      MS-DOS, Microsoft, and Word are trademarks of Microsoft Corp.
  103.      Tornado Notes is a trademark of Micro Logic Corp.
  104.      Hotline is a trademark of General Information, Inc.
  105.  
  106.      (C)Copyright 1986-1989, 1990 by CalcTech Inc.  Specifications
  107.      herein are subject to change without notice.
  108.  
  109.  
  110.                                    - 2 -
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.                  Registration & Commercial Version Upgrade
  120.  
  121.  
  122.  
  123.      When  you register XACT-16C for only  $28.00  +  $4.00  shipping,
  124.      we'll mail you the COMMERCIAL  VERSION UPGRADE to the program. It
  125.      contains a number of features  not  available  in  this shareware
  126.      version including:
  127.  
  128.  
  129.          o  TSR RAM-Resident (Pop-Up) capability
  130.          o  Pop-Up ASCII Table
  131.          o  Mouse Support
  132.          o  Import/Export data from an application
  133.          o  Full programming. Programs may be saved as disk files.
  134.          o  Simulated tape which may be viewed, printed, stamped
  135.             with messages, and saved to disk.
  136.          o  Typeset printed user's manual
  137.          o  Discounts on future upgrades and notice of new products
  138.  
  139.  
  140.      Or, you may  wish  to  register  all three XACT calculators:  the
  141.      XACT-11C SCIENTIFIC, XACT-12C FINANCIAL, and XACT-16C PROGRAMMER,
  142.      for only  $48.00 + $4.00 shipping, and receive COMMERCIAL VERSION
  143.      UPGRADES for all three calculators.
  144.  
  145.      Why not register today?
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.                                    - 3 -
  168.  
  169.  
  170.  
  171.                XACT SERIES CALCULATORS - REGISTRATION ORDER FORM
  172.  
  173.  
  174.      +------+----------------------------------------+----------+----------+
  175.      | Quan |  Description                           |  Price   |  Total   |
  176.      +======+========================================+==========+==========+
  177.      |      |                                        |          |          |
  178.      |      |  XACT-11C Scientific Calculator        |  $28.00  |          |
  179.      +======+========================================+==========+==========+
  180.      |      |                                        |          |          |
  181.      |      |  XACT-12C Financial Calculator         |  $28.00  |          |
  182.      +======+========================================+==========+==========+
  183.      |      |                                        |          |          |
  184.      |      |  XACT-16C Programmer's Calculator      |  $28.00  |          |
  185.      +======+========================================+==========+==========+
  186.      |      |  SPECIAL OFFER!                        |          |          |
  187.      |      |  All 3  (XACT-11C, XACT-16C, XACT-16C) |  $48.00  |          |
  188.      +======+========================================+==========+==========+
  189.                        |                                        |          |
  190.                        | WA. state residents add 8.1% sales tax |          |
  191.                        +========================================+==========+
  192.                                             |                   |          |
  193.      Mail this form to:                     | Shipping/Handling |  $4.00   |
  194.                                             +===================+==========+
  195.      CalcTech, Inc.                                      Total  |          |
  196.      13629 Bellevue-Redmond Rd. Suite 202               Amount  |          |
  197.      Bellevue, WA.  98005                             Enclosed  +==========+
  198.      (206) 643-1682
  199.  
  200.  
  201.      Your Name: ______________________________  Phone: _____________________
  202.  
  203.      Company (if applicable)________________________________________________
  204.  
  205.      Address: ______________________________________________________________
  206.  
  207.      City: ________________________________  State __________ Zip __________
  208.  
  209.  
  210.  
  211.  
  212.      [ ] Check Enclosed   [ ] VISA         [ ] Mastercard
  213.  
  214.      Credit card #:____________________________________ Exp. Date: ____/____
  215.  
  216.      Signature: ____________________________________________________________
  217.  
  218.      Cardholder's name: ____________________________________________________
  219.  
  220.  
  221.  
  222.  
  223.  
  224.                                    - 4 -
  225.  
  226.  
  227.  
  228.  
  229.           ! ! ! !   P L E A S E    R E A D    T H I S   ! ! ! !
  230.  
  231.  
  232.      This  user's  manual  contains  complete  documentation  for  the
  233.      COMMERCIAL  VERSION  of  XACT-16C.  As such, some of the features
  234.      described  within  this  manual will not be  available  with  the
  235.      SHAREWARE VERSION of the program included on this disk.
  236.  
  237.  
  238.      We have included documentation for the COMMERCIAL VERSION UPGRADE
  239.      so that should you find benefit from the use  of  these  programs
  240.      and decide to register (and we  hope  you will), you would have a
  241.      good idea of what to  expect from the COMMERCIAL VERSION UPGRADE.
  242.      Please  note  that  this  is  not the actual  commercial  version
  243.      documentation  but rather a disk based  "reprint".    Should  you
  244.      decide to register,  you  will receive a complete typeset printed
  245.      manual of the product(s).
  246.  
  247.  
  248.      XACT SERIES  CALCULATORS are shareware, not freeware.  Payment is
  249.      voluntary and on the "honor system".  We ask  that  you  register
  250.      the  product(s) if after a short period of  use,  you  find  them
  251.      useful in your work.  We hope that you appreciate the "try before
  252.      you buy" concept and that you will register.
  253.  
  254.  
  255.      Anyone who has ever  purchased  expensive  (or  even inexpensive)
  256.      software can attest to  the  frustration  of  being "burned" by a
  257.      lousy product.  We  think  XACT  SERIES CALCULATORS are excellent
  258.      products  but  we're  giving  you  the opportunity to  judge  for
  259.      yourself.  If you agree, please take a moment to register.
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.                                    - 5 -
  282.                              TABLE OF CONTENTS
  283.  
  284.  
  285.  
  286.      Section  Title                                                    Page
  287.  
  288.      1      Getting Started  ..........................................  8
  289.  
  290.      1.1         Introduction .........................................  8
  291.      1.2         Other Guides .........................................  8
  292.      1.3         System Requirements ..................................  9
  293.      1.4         Installing XACT-16C and Making Backups ...............  9
  294.      1.5         Command Line Options & Changing Hot Keys .............  9
  295.  
  296.      2      Loading XACT-16C .......................................... 11
  297.  
  298.      2.1         XACT-16C Shareware Version ........................... 11
  299.      2.2         XACT-16C as a RAM Resident Program ................... 11
  300.      2.3         XACT-16C as a Removable RAM Resident Program ......... 11
  301.      2.4         XACT-16C as a standalone DOS program ................. 12
  302.  
  303.      3      XACT-16C Basics ........................................... 13
  304.  
  305.      3.1         Keyboard Conventions ................................. 13
  306.      3.2         Function Key Usage ................................... 13
  307.      3.3         Prefix Keys .......................................... 13
  308.  
  309.      4      Features (Commercial Version) ............................. 14
  310.  
  311.      4.1         Getting Help ......................................... 14
  312.      4.2         Viewing the Tape ..................................... 14
  313.      4.3         Feeding a Result ..................................... 14
  314.      4.4         Stamping the Tape .................................... 14
  315.      4.5         Printing the Tape .................................... 15
  316.      4.6         Storing the Tape ..................................... 15
  317.      4.7         Loading a Program .................................... 15
  318.      4.8         Storing a Program .................................... 15
  319.      4.9         Importing Data from an Application ................... 16
  320.      4.10        ASCII Table .......................................... 16
  321.  
  322.      5      Using XACT-16C ............................................ 17
  323.  
  324.      5.1         Prefix Keys .......................................... 17
  325.      5.2         Clearing the Display and Prefix Keys ................. 17
  326.      5.3         Entering Numbers ..................................... 17
  327.      5.4         Short Cut Keys ....................................... 18
  328.      5.5         RPN Logic, the Stack and the ENTER Key ............... 18
  329.      5.6         Stack Operations ..................................... 19
  330.      5.7         Memories and Memory Operations ....................... 19
  331.      5.8         The Index Register and Using Memories Indirectly ..... 20
  332.      5.9         Modes of Operation and Word Size ..................... 20
  333.      5.10        1's Compliment Numbers ............................... 21
  334.      5.11        2's Compliment Numbers ............................... 21
  335.  
  336.  
  337.  
  338.                                    - 6 -
  339.      Section  Title                                                    Page
  340.  
  341.      5.12        Unsigned Numbers ..................................... 21
  342.      5.13        Word Size ............................................ 21
  343.      5.14        "SHOW" Functions ..................................... 22
  344.      5.15        Display Windows ...................................... 22
  345.      5.16        Flags ................................................ 23
  346.      5.17        Status ............................................... 24
  347.  
  348.      6      Arithmetic, Bit Manipulation, and Logical Functions ....... 25
  349.  
  350.      6.1         Addition and Subtraction ............................. 25
  351.      6.2         Multiplication and Division .......................... 25
  352.      6.3         Remainder after Division ............................. 25
  353.      6.4         Square Root .......................................... 26
  354.      6.5         Absolute Value ....................................... 26
  355.      6.6         Logical Functions .................................... 26
  356.      6.7         Bit Functions ........................................ 27
  357.      6.8         Summing Bits ......................................... 28
  358.      6.9         Masking .............................................. 28
  359.      6.10        Left Justify ......................................... 28
  360.  
  361.      7      Shifting and Rotating Bits ................................ 29
  362.  
  363.      7.1         Shift Instructions ................................... 29
  364.      7.2         Rotate Instructions .................................. 29
  365.  
  366.      8      Floating Point Mode ....................................... 30
  367.  
  368.      8.1         Converting to Floating Point Mode .................... 30
  369.      8.2         Floating Point Calculations .......................... 30
  370.      8.3         Returning to Integer Mode ............................ 31
  371.  
  372.      9      Programming XACT-16C ...................................... 32
  373.  
  374.      9.1         Introduction to Programming .......................... 32
  375.      9.2         Entering a Program ................................... 32
  376.      9.3         Labels in Programs ................................... 33
  377.      9.4         Using Subroutines .................................... 34
  378.      9.5         Returning From a Program or Subroutine ............... 34
  379.      9.6         Entering Data and the Run/Stop Key ................... 34
  380.      9.7         Branching Using the Index Register ................... 35
  381.      9.8         Program Loops Using the Index Register ............... 35
  382.      9.9         Program Loops and Branches Using the X and Y Registers 36
  383.      9.10        Branching Using Flags ................................ 36
  384.      9.11        Branching On Bit Set/Clear ........................... 37
  385.      9.12        The Single-Step Instruction .......................... 37
  386.      9.13        Moving to a Program Line Number ...................... 38
  387.  
  388.      10     Appendix .................................................. 38
  389.  
  390.      10.1        Error Conditions ..................................... 38
  391.  
  392.  
  393.  
  394.  
  395.                                    - 7 -
  396.      1 Getting Started
  397.  
  398.  
  399.  
  400.      1.1 Introduction
  401.  
  402.      XACT-16C is a software emulation  of  the  famous Hewlett-Packard
  403.      HP-16C.  If you are familiar with the HP-16C, you will  find that
  404.      you  already  know how to use XACT-16C.    If  not,  you'll  find
  405.      XACT-16C easy to  learn  and  use.   It will become an invaluable
  406.      tool in your work.
  407.  
  408.      XACT-16C  is a RAM resident program  (Commercial  Version).    It
  409.      remains loaded in your computer's memory ready to "pop-up" at the
  410.      activation of a "hot key", even if you're running another program
  411.      at  the  time.   XACT-16C can also be run as  a  stand-alone  DOS
  412.      program, if desired.
  413.  
  414.      If you are already familiar with DOS and with the HP-16C, you may
  415.      only need to read Chapters 2 and 3.    This  will  provide enough
  416.      information to get you started.
  417.  
  418.      If you are new to DOS and/or the HP-16C, you may wish to read, or
  419.      at least skim, Chapters 1 through 6.
  420.  
  421.      NOTE:
  422.  
  423.      A number of  the  function  keys  on  the  XACT-16C  use graphics
  424.      characters to represent them.  Because this  disk-based shareware
  425.      documentation is printed  in  ASCII text mode, some function keys
  426.      cannot be accurately shown in this file.  We've tried our best to
  427.      emulate the look of the graphics  symbols  and to make it easy to
  428.      infer  which  functions  are  intended  from the context  of  the
  429.      Documentation.
  430.  
  431.  
  432.  
  433.      1.2 Other Guides
  434.  
  435.      There are a number  of  guides  and  references available for the
  436.      HP-16C  that  can  be  used  with  XACT-16C  as  well.  These are
  437.      generally available in bookstores and other places where Hewlett-
  438.      Packard calculators are sold.   Some  of  these  publications are
  439.      listed below
  440.  
  441.      "HP-16C  Owner's  Handbook  and  Problem  Solving  Guide"  Covers
  442.      general  operations, functions, applications, and programming  of
  443.      the HP-16C.  Published by the Hewlett-Packard Company.
  444.  
  445.      "An Easy Course in using the HP-16C" by Ed  Keefe.  Published  by
  446.      Grapevine Publishing, Inc. P.O. Box 118, Corvallis, OR, 97339.
  447.  
  448.  
  449.  
  450.  
  451.  
  452.                                    - 8 -
  453.      1.3 System Requirements
  454.  
  455.      To operate the XACT-16C calculator, you will need an IBM  PC, PC-
  456.      XT, PC-AT, PS/2, or close compatible equipped with  at  least the
  457.      following:
  458.  
  459.         256K RAM
  460.         One floppy disk drive
  461.         PC-DOS or MS-DOS version 2.00 or later
  462.  
  463.  
  464.  
  465.      1.4 Installing XACT-16C and Making Backups
  466.  
  467.      You should make a copy of the programs contained on  the XACT-16C
  468.      diskette for backup purposes. Use  the DOS "copy" command to copy
  469.      all the files to another diskette or to your hard disk. There may
  470.      be  a  file  named README.DOC on your disk.  If  so,  you  should
  471.      examine it using your word processor or the  DOS  "type" command.
  472.      You may wish to  install  XACT-16C  in  your AUTOEXEC.BAT file so
  473.      that  it's  automatically  ready each time you power up or reboot
  474.      your computer.  If you  are unfamiliar with an AUTOEXEC.BAT file,
  475.      see your DOS manual.
  476.  
  477.  
  478.  
  479.      1.5 Command Line Options/Changing Hot-Keys (Commercial Version)
  480.  
  481.      A command line option  is  an  additional  command typed when you
  482.      first  load  XACT-16C.    There  are  several  of  these  options
  483.      available.   For example, if you wish to  save  memory  space  by
  484.      running  XACT-16C in non RAM-Resident mode,  you  would  use  the
  485.      nopop command line option, i.e.:
  486.  
  487.          x16  /nopop  [ENTER]
  488.  
  489.      ([ENTER] means press  the  ENTER  key).   You can also change the
  490.      invocation "hot-key" using a command line  option.  Valid hot-key
  491.      definitions are Alt-Shift-P (default), Alt-P, and Alt-Ctrl-P. For
  492.      example, to change the  invocation  "hot-key"  from  it's default
  493.      setting of Alt-Shift-P to Alt-P,  and  also  change  the tapefile
  494.      name to test.txt in the \bin directory:
  495.  
  496.          x16  /alt-p   /tapefile=\bin\test.txt
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.                                    - 9 -
  510.      The  following  is  a  list  of available command  line  options:
  511.      (Commercial Version only)
  512.  
  513.         /nopop        Run XACT-16C in non RAM Resident mode.
  514.         /mono         Force XACT-16C into monochrome mode.
  515.         /wsize=       Set the machine word size on startup.
  516.         /radix=       Set radix on startup.  Radix types are
  517.                       h,d,o,b, or f. (Hex,dec,oct,bin,float).
  518.         /tapefile=    Name of file used to save the tape.
  519.         /alt-p        Change the invocation key to Alt-P.
  520.         /alt-ctrl-p   Change the invocation key to Alt-Ctrl-P.
  521.         /nomouse      Disable mouse operation.
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.                                    - 10 -
  567.      2 Loading XACT-16C
  568.  
  569.  
  570.  
  571.      2.1 XACT-16C shareware version
  572.  
  573.      To load the Shareware XACT-16C, at the DOS prompt type:
  574.  
  575.          x16share [ENTER]
  576.  
  577.  
  578.  
  579.      2.2 XACT-16C as a RAM Resident program    (Commercial Version)
  580.  
  581.      To load XACT-16C, at the DOS prompt type:
  582.  
  583.          x16 [ENTER]
  584.  
  585.      You will see  the  copyright  message  appear on the screen.  The
  586.      computer  will then return to the DOS prompt  and  appear  as  if
  587.      nothing had happened.    However, the XACT-16C calculator has now
  588.      been loaded into your computer's memory and is ready to pop-up at
  589.      the activation of the hot key.  To activate XACT-16C, press:
  590.  
  591.          Alt-Shift-P
  592.  
  593.      XACT-16C  will  now  appear  on  your  screen,  ready to  perform
  594.      calculations.  To exit from XACT-16C, press the Esc key.
  595.  
  596.  
  597.  
  598.      2.3 XACT-16C as a  Removable  RAM-Resident  Program   (Commercial
  599.      Version)
  600.  
  601.      When XACT-16C is loaded  as  a RAM Resident program as in section
  602.      2.1 above, it remains loaded in your computer's memory until your
  603.      computer is rebooted  or  powered  off.   There is another way to
  604.      install  XACT-16C in such a way that it  may  be  removed  memory
  605.      without rebooting.   To  do  so,  you must use the TSRADD.COM and
  606.      TSRDROP.COM utilities provided.  Using  this  method,  to install
  607.      XACT-16C, you would type at the DOS prompt:
  608.  
  609.          tsradd x16 [ENTER]
  610.          x16 [ENTER]
  611.  
  612.      In fact, you may load RAM-Resident programs from other vendors as
  613.      well  using  the  TSRADD.COM utility.  For example, to load other
  614.      vendor's TSR's such as Tornado Notes and Hotline, you would type:
  615.  
  616.          tsradd tn [ENTER]
  617.          tn [ENTER]
  618.          tsradd hotline [ENTER]
  619.          hotline [ENTER]
  620.  
  621.  
  622.  
  623.                                    - 11 -
  624.      If you aren't running these programs from your current directory,
  625.      be sure to provide  a  complete pathname, or use the PATH command
  626.      provided with DOS.
  627.  
  628.      To remove your  memory  resident  programs,  use  the TSRDROP.COM
  629.      utility.  It is necessary to drop your TSR's in the reverse order
  630.      that they were added.  When you run TSRDROP.COM, the utility will
  631.      prompt you with  the  next  TSR  to be removed from memory. Press
  632.      ENTER to confirm the drop or Esc to exit the utility.
  633.  
  634.  
  635.  
  636.      2.4 XACT-16C as a Stand Alone Program  (Commercial Version)
  637.  
  638.      XACT-16C defaults to being a RAM Resident program,  but  can also
  639.      be run as a stand-alone DOS program.  To run XACT-16C as a stand-
  640.      alone program, type:
  641.  
  642.         x16 /nopop  [ENTER]
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.                                    - 12 -
  681.      3 XACT-16C Basics
  682.  
  683.  
  684.  
  685.      3.1 Keyboard Conventions
  686.  
  687.      Throughout this manual, XACT-16C function keys are denoted within
  688.      a box.  For example, the  function  key  for a left shift (SL) is
  689.      shown as [SL].    In  the  case  of function keys which require a
  690.      prefix key (discussed in the next section), the prefix key is not
  691.      given in this manual since it can easily be determined.
  692.  
  693.      Keys on the PC keyboard are listed in this  manual  using  single
  694.      quotes  such as 'a'.  Numbers to be  entered  into  XACT-16C  are
  695.      shown  in normal type, except for the hex  numbers  A  through  F
  696.      which are shown as function keys.
  697.  
  698.  
  699.  
  700.      3.2 Function Key Usage
  701.  
  702.      XACT-16C has approximately 70 different function keys arranged in
  703.      the same ordering as  on  the HP-16C.  Function keys are arranged
  704.      in  groups of up to 3 functions per key; an upper, a lower and  a
  705.      middle  function  all  correspond to one function key.  The upper
  706.      and  lower  functions  are invoked by first pressing a prefix key
  707.      (discussed in the next  section)  and then the function key.  The
  708.      middle function does not require the use of a prefix key.  The PC
  709.      keystroke corresponding to function key is  shown  immediately to
  710.      the left of the function box.
  711.  
  712.      The  first  row  of function keys use the PC keys F1 through F10.
  713.      The second through  fourth  rows use the alphabetic characters as
  714.      arranged left to right on your PC keyboard.
  715.  
  716.      For example,  the XACT-16C's [Sto] (store) function key is mapped
  717.      to the letter  'v'  on  the  PC  keyboard.    Likewise, the [ A ]
  718.      function key is invoked by pressing F1.
  719.  
  720.  
  721.      3.3 Prefix Keys
  722.  
  723.      The left and the right shift  keys  on the PC keyboard operate as
  724.      prefix keys, functionally equivalent to the gold [ f  ]  and  the
  725.      blue  [ g ] keys on the HP-16C.  They let you activate the  upper
  726.      and lower sets of functions assigned to a function key.  The left
  727.      shift key on the PC is used as a prefix key to activate the upper
  728.      set of functions.  The right shift key is used as a prefix key to
  729.      activate the lower set of functions.  For example, to  invoke the
  730.      [SR]  function,  you  would press and release the left shift key,
  731.      then press  F2.    To  invoke  the  [ASR] function, you press and
  732.      release the right shift key, then F2.  Likewise,  to  invoke  the
  733.      [sqrtx] function, you would press  and  release  the  right shift
  734.      key, then press 't'.
  735.  
  736.  
  737.                                    - 13 -
  738.      4. Features  (Commercial version only)
  739.  
  740.  
  741.  
  742.      4.1 Getting Help
  743.  
  744.      A Help menu is available when you are working with XACT-16C.   To
  745.      obtain help press:
  746.  
  747.          Alt-F1
  748.  
  749.      An information screen will appear in a window.  The help menu can
  750.      be removed by pressing F1 again.
  751.  
  752.  
  753.  
  754.      4.2 Viewing the Tape
  755.  
  756.      XACT-16C provides a  simulated  tape display which keeps a record
  757.      of your  calculations  as  you  perform  them.   To view the tape
  758.      press:
  759.  
  760.          Alt-F2
  761.  
  762.      The tape will appear in a window.  To remove  the  tape, press F2
  763.      again.
  764.  
  765.  
  766.  
  767.      4.3 Feeding a Result
  768.  
  769.      To  feed  the  result  of  a calculation into the program  you're
  770.      running press:
  771.  
  772.          Alt-F3
  773.  
  774.      The calculator will disappear and  the number in the display will
  775.      be fed to your application.
  776.  
  777.  
  778.  
  779.      4.4 Stamping the Tape
  780.  
  781.      To stamp a message on the simulated tape press:
  782.  
  783.          Alt-F4
  784.  
  785.      The message will appear on the tape as  well  as  the  printer or
  786.      tape disk file if either of these options are being used.
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.                                    - 14 -
  795.      4.5 Printing the Tape
  796.  
  797.      To print the tape as you make calculations press:
  798.  
  799.          Alt-F5
  800.  
  801.      To turn off printing, press F5 again.
  802.  
  803.  
  804.  
  805.      4.6 Storing the Tape
  806.  
  807.      The simulated tape may be  saved  to  a  disk  file  as  you make
  808.      calculations.   Each  time  you  use  XACT-16C,  calculations are
  809.      appended to the tape file.  To store the tape, press
  810.  
  811.          Alt-F6
  812.  
  813.      The  tape will be saved under the name  X16.TAP  in  the  current
  814.      directory.  If you change directories, a different tape file with
  815.      the same name  will be used.  If you wish to use a different name
  816.      for   your   tape   file,   use   the    command    line   option
  817.      /tapefile=filename where filename is any valid DOS filename which
  818.      can include a path (see section 1.6).
  819.  
  820.  
  821.  
  822.      4.7 Loading a Program
  823.  
  824.      To load a program previously saved press:
  825.  
  826.          Alt-F7
  827.  
  828.      A window  will  appear  requesting  a  file  name.  Enter the DOS
  829.      filename of the program you wish to retrieve.
  830.  
  831.  
  832.  
  833.      4.8 Storing a Program
  834.  
  835.      XACT-16C  allows  you  to save programs as disk files.  To save a
  836.      program on disk, press:
  837.  
  838.          Alt-F8
  839.  
  840.      A window will appear  prompting  you for comments.  You can enter
  841.      up to 3 lines of comments, associated with the  program  you  are
  842.      saving.  Press the  Esc  key after you have entered any comments.
  843.      Another window will appear prompting you for a  filename.   Enter
  844.      any valid DOS filename.
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.                                    - 15 -
  852.      4.9 Importing Data from an Application
  853.  
  854.      You can "import" data from the screen of the previous program you
  855.      were running before  popping-up  XACT-16C.  For instance, you may
  856.      be working with a spreadsheet or word-processing program and wish
  857.      to  add  a  series of numbers from the display screen.  To import
  858.      data, press:
  859.  
  860.          Alt-F9
  861.  
  862.      You will see the screen you were working  with  before popping-up
  863.      XACT-16C.    However,  you  have  not returned to  your  previous
  864.      program.  Use the up, down, left, or right arrow keys to move the
  865.      cursor to a number on the screen you wish to import.  Then, press
  866.      F9 again to import the number into XACT-16C.  It will appear just
  867.      as  if  you  had typed it in by hand.  If you now press F9 again,
  868.      you'll see the cursor will have moved down a row. This is to help
  869.      facilitate the importing of  a  "column" of numbers.  If you wish
  870.      to accept the  data  where  the  cursor rests, again press F9. If
  871.      not, use the arrow keys to move to the desired location.
  872.  
  873.      It isn't possible to import data  from  a screen if the screen is
  874.      in graphics  mode.    In  this  case,  XACT-11C will sound a beep
  875.      indicating  that it can't import a number.    One  commonly  used
  876.      program which utilizes graphics mode is Microsoft Word.    If you
  877.      use  Word, you should use text mode.   Pressing  Alt-F9  in  Word
  878.      allows you to switch between graphics and text modes.
  879.  
  880.  
  881.  
  882.      4.10 ASCII Table
  883.  
  884.      An ASCII table will appear in a window over XACT-16C by pressing
  885.  
  886.          Alt-F10
  887.  
  888.      Press the PgUp or PgDn keys  to  move through the ASCII table, or
  889.      press  Esc to remove the ASCII table.
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.                                    - 16 -
  909.      5. USING XACT-16C
  910.  
  911.  
  912.  
  913.      5.1 Prefix Keys
  914.  
  915.      The left and the right shift  keys  on the PC keyboard operate as
  916.      prefix keys, functionally equivalent to the gold [ f  ]  and  the
  917.      blue  [ g ] keys on the HP-16C.  They let you activate the  upper
  918.      and  lower sets of functions assigned to each PC  key.   The left
  919.      shift key on the PC is used as a prefix key to activate the upper
  920.      set of functions.  Likewise, the right shift  key  is  used  as a
  921.      prefix key to activate the lower set of functions.    The  prefix
  922.      keys are "sticky", that is, you press a prefix key and it remains
  923.      set, even after you release the key.  When you press  and release
  924.      a prefix key,  the  corresponding set of prefixes will highlight,
  925.      indicating which prefix was set.  To clear a prefix key,  use the
  926.      [PRFX] function.
  927.  
  928.      For example, to activate the [HEX] function, press the letter 'e'
  929.      on the PC keyboard.  On the other hand, the [DSZ] function key is
  930.      mapped  to  the  same PC key as the [Hex] function but requires a
  931.      prefix key.  To invoke the [DSZ] function, press and  release the
  932.      right  shift  key,  (the  lower  prefix key), and then press  the
  933.      letter 'e'.
  934.  
  935.      The prefix keys can also be invoked using the function keys [ f ]
  936.      and [ g ].
  937.  
  938.  
  939.  
  940.      5.2 Clearing the Display and Prefix Keys
  941.  
  942.      To  clear  a number in the display,  press  the  [CLx]  (Clear  X
  943.      Register) key.  The display will now contain the value 0.   While
  944.      entering a number, you may clear the last digit entered  with the
  945.      [BKSP] key.  For example, if  you  meant to enter the number 1234
  946.      and mistakenly entered 1235,  press  [BKSP]  and  then press 4 to
  947.      correct  the  number.   To clear a prefix key, i.e., the lower or
  948.      the upper prefix, press the [PREFIX] key.  To  clear  all  memory
  949.      storage registers, press  [REG].   This key doesn't affect values
  950.      stored in the stack or the LastX register.
  951.  
  952.  
  953.  
  954.      5.3 Entering Numbers
  955.  
  956.      Numbers  are  entered  into XACT-16C by using the numeric keys or
  957.      the  numeric keypad for the numbers 0 through  9,  and  the  keys
  958.      mapped to the hex numbers A  through  F  on the PC keyboard.  The
  959.      decimal point key is only  operational in floating point mode and
  960.      is mapped to  the  '.'  key  on  the numeric keypad.  Notice that
  961.      XACT-16C  will  not  accept  certain  numbers  in   integer  mode
  962.      depending on the radix value being used.   If  the  radix  is Bin
  963.  
  964.  
  965.                                    - 17 -
  966.      (Binary), XACT-16C will only accept the numeric digits  0  and 1,
  967.      all others are  ignored.    When  using the Octal radix, only the
  968.      digits  0  through  7 are valid, and so on.  XACT-16C will accept
  969.      only  as  many  entered  digits  as  the  current word  size  and
  970.      complement mode will allow.  For example:
  971.  
  972.      Keystroke                 Display        Comment
  973.      ================================================================
  974.      [Dec]                                    Set decimal mode
  975.      8 [Wsize]
  976.      [2's]                                    2's comp. 8 bit
  977.  
  978.      255                       -1 Dec
  979.      [Unsgn]                  255 Dec
  980.  
  981.      The  number   255  (FF  Hex)  cannot  be  represented  using  2's
  982.      complement  8 bit math. Since the high order bit  (interpreted as
  983.      a sign bit)  is  a 1, the 2's complement of the number is formed.
  984.      When unsigned math  is used, the number is interpreted correctly.
  985.      Notice that if you tried  to enter the number 256 (100 Hex) while
  986.      operating with a word size  of 8 bits, the  last  digit would not
  987.      be accepted since 256 requires  a word size of at least 9 bits to
  988.      be represented.
  989.  
  990.  
  991.  
  992.      5.4 Short Cut Keys
  993.  
  994.      You can use the Enter key  on  the  PC, (also known as the Return
  995.      key)  as the XACT-16C [ENTER] key as a short cut.  Also, the '+',
  996.      '-', '*', and '/'  keys   adjacent to the numeric keypad function
  997.      as you would expect.
  998.  
  999.  
  1000.  
  1001.      5.5 RPN Logic, the Stack, and the ENTER key
  1002.  
  1003.      You may already  be  familiar with Reverse Polish Notation (RPN).
  1004.      RPN  is a type of  calculator  logic that eliminates the need for
  1005.      the equals   key  and for parenthesis in calculator computations.
  1006.      Instead, operands   are entered into the calculator and separated
  1007.      using the [ENTER] key.  For example, to add the numbers 3 and 4:
  1008.  
  1009.      Keystroke                 Display        Comment
  1010.      ================================================================
  1011.      [Dec]                                    Decimal mode
  1012.      3 [ENTER]                 3 Dec
  1013.      4 [ + ]                   7 Dec          Add
  1014.  
  1015.      The result, 7, is now displayed.  To multiply this result by 5:
  1016.  
  1017.      Keystroke                 Display        Comment
  1018.      ================================================================
  1019.      5 [ * ]                   35 Dec
  1020.  
  1021.  
  1022.                                    - 18 -
  1023.      The way that XACT-16C performs  these calculations with RPN is by
  1024.      using a stack.  The stack consists of 4 registers:  X,  Y, Z, and
  1025.      T.   It is not generally necessary  to  understand  the  internal
  1026.      workings of the stack but for completeness they  will  briefly be
  1027.      discussed below.
  1028.  
  1029.      Any number displayed is said to be in the X  register.   When the
  1030.      [ENTER] key is pressed, a number in the X Register is pushed into
  1031.      the Y  Register  and  the  previous  number  in the Y Register is
  1032.      pushed  into  the  Z  Register.    The  previous  number in the Z
  1033.      register   is pushed into the T Register.  T stands for "Top" and
  1034.      represents the top of  the  stack of numbers.  The previous value
  1035.      of the T register   is lost.  When a function key such as the [+]
  1036.      key  is pressed, the value held in the Y register is added to the
  1037.      X register  and  this  result  is  now  stored in the X register.
  1038.      Pressing  [ENTER]  does  one  other  thing, it leaves  the  stack
  1039.      disabled. This means that a  number entered after the [ENTER] key
  1040.      has  been pressed is not pushed on the stack, it remains in the X
  1041.      register.  Most operations enable the stack so that  when  a  new
  1042.      number  is  entered,  the previous contents of the X register are
  1043.      pushed into the Y register.  The most notable exceptions  to this
  1044.      rule are the [ENTER] and the [Clx] function keys.
  1045.  
  1046.  
  1047.  
  1048.      5.6 Stack Operations
  1049.  
  1050.      Roll Up - The [R|] function rolls up the stack.    The X register
  1051.      is copied  into the Y  register.    The Y register is copied into
  1052.      the  Z  register,   and the Z  register  is  copied  into  the  T
  1053.      register.  The T register is "rolled around" into the X register.
  1054.  
  1055.      Roll Down - The [R|]  function  rolls  down  the  stack.    The T
  1056.      register  is  copied   into the Z register.  The  Z  register  is
  1057.      copied  into  the  Y register,  and the Y register is copied into
  1058.      the  X  register.  The X register  is rolled around  into  the  T
  1059.      register.
  1060.  
  1061.      X exchange Y - The [x<>y] function exchanges the contents  of the
  1062.      X and Y registers.
  1063.  
  1064.      Last X register - The [LSTx] register holds the previous contents
  1065.      of the X register before an operation was performed.   The [LSTx]
  1066.      register  is  used  to restore the number entered if an incorrect
  1067.      function key is mistakenly pressed.
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.      5.7 Memories and Memory Operations
  1074.  
  1075.      XACT-16C  has  16  memories that can  be  used  for  storing  and
  1076.      recalling  numbers.    These memories are called memory registers
  1077.  
  1078.  
  1079.                                    - 19 -
  1080.      and  are  referred   to as registers R0 through R9 and RA through
  1081.      RF. To store  a  number  in a memory, press [Sto] n, where n is a
  1082.      number 0 through 9 (using the numeric keypad)  or hex  number [A]
  1083.      through [F].
  1084.  
  1085.      For example:
  1086.  
  1087.      Keystroke                 Display        Comment
  1088.      ================================================================
  1089.      32 [Sto] [ A ]            32 Dec         32 in register RA
  1090.      14 [Sto] 2                14 Dec         14 in register R2
  1091.      [Rcl] [ A ]               32 Dec         Recall reg. RA
  1092.      [Rcl] 2 [ + ]             46 Dec         Add to reg. R2
  1093.  
  1094.  
  1095.      Notice in the preceding example that  the  [  A ] key is a mapped
  1096.      XACT-16C  key,  not  the letter 'A' on the  PC  keyboard  (it  is
  1097.      invoked by pressing the F1 key on the PC keyboard.
  1098.  
  1099.  
  1100.  
  1101.      5.8 The Index Register and Using Memories Indirectly
  1102.  
  1103.      Memories  can  also  be  accessed  indirectly  using   the  Index
  1104.      register.    The    index  register  is  accessed with the [ I  ]
  1105.      function key.    A  number  may  be  stored in the index register
  1106.      using  [Sto] [ I ] and recalled from  the  index  register  using
  1107.      [Rcl] [ I ].  Also, the [x<>I] function key  is  used to exchange
  1108.      the X register with the Index Register in the same fashion as the
  1109.      [x<>y] function key is used to exchange the X  and  Y  registers.
  1110.      For the examples below, assume STATUS= 2-16-0000.
  1111.  
  1112.      Keystroke                 Display        Comment
  1113.      ================================================================
  1114.      5 [Sto] [ I ]             5 Dec          Register I= 5
  1115.      20 [Sto] [(i)]           20 Dec          Register 5= 20
  1116.      [CLx]                     0 Dec          Clear X reg
  1117.      [Rcl] 5                  20 Dec          Reg 5= 20
  1118.  
  1119.  
  1120.      In the above example, the  Indirect Index Register [(i)] was used
  1121.      to store a number indirectly.  The memory register   accessed was
  1122.      determined by the contents  of  the  [I]  register.  Memories can
  1123.      also be recalled indirectly using  the operation [Rcl] [(i)], and
  1124.      exchanged  with  the  X  register  indirectly  using  the  [x(i)]
  1125.      function.
  1126.  
  1127.  
  1128.  
  1129.      5.9 Modes of Operation and Word Size
  1130.  
  1131.      XACT-16C operates in 2 modes, integer and floating point. Integer
  1132.      mode  is  active  when  any  of  the  following radix  conversion
  1133.      function  keys are pressed: [HEX], [DEC], [OCT], [BIN]
  1134.  
  1135.  
  1136.                                    - 20 -
  1137.      These keys allow numbers in integer mode to be displayed  in hex,
  1138.      decimal, octal  and binary respectively.  In addition, numbers in
  1139.      integer mode may be  interpreted  as  unsigned  values, or as 1's
  1140.      complement or 2's complement numbers using word sizes  from  2 to
  1141.      64 bits.
  1142.  
  1143.  
  1144.  
  1145.      5.10 1's Complement Numbers
  1146.  
  1147.      To use 1's complement  arithmetic,  press  [1's]. All numbers and
  1148.      operations entered while in integer  mode  will be interpreted as
  1149.      1's complement numbers.  Pressing  the  [ChS]  function  key will
  1150.      display the 1's complement of a number  in the display.
  1151.  
  1152.  
  1153.  
  1154.      5.11 2's Complement Numbers
  1155.  
  1156.      Pressing [2's] will activate 2's  complement  arithmetic  when in
  1157.      integer mode.  All operations subsequently performed will be done
  1158.      using  2's complement arithmetic.  2's  complement  mode  is  the
  1159.      default mode when XACT-16C is first loaded.
  1160.  
  1161.  
  1162.  
  1163.      5.12 Unsigned Numbers
  1164.  
  1165.      Pressing  [Unsgn]  will  activate  unsigned  arithmetic  when  in
  1166.      integer mode.   All  arithmetic  operations  will  be interpreted
  1167.      using unsigned math.   When  the [ChS] key is pressed, the result
  1168.      has  no  meaning.   However, the  2's complement of the number is
  1169.      displayed along with the Overflow flag, shown as  the  letter 'G'
  1170.      to the right of the number.
  1171.  
  1172.  
  1173.  
  1174.      5.13 Word Size
  1175.  
  1176.      In decimal mode, XACT-16C can operate using any word size  from 2
  1177.      to  64  bits.   To set the word size, enter a number from 2 to 64
  1178.      and  press [Wsize].  Notice that if you're  using  a  small  word
  1179.      size,  say 4 bits, you won't be able to enter the number into the
  1180.      calculator larger than +3 (if  you're  in  2's  complement mode).
  1181.      Thus, you won't be able  to increase the word size to say 16 bits
  1182.      without first resetting the word size to 64 bits.
  1183.  
  1184.  
  1185.      To reset the word size to  64  bits,  press 0 [Wsize].  This will
  1186.      allow    you  to then set a word size of  say  16  bits  if,  for
  1187.      example,  you  were   previously using a 4 bit word size and thus
  1188.      couldn't enter the number 16 to set a 16 bit word size.
  1189.  
  1190.  
  1191.  
  1192.  
  1193.                                    - 21 -
  1194.      Changing  word  size  will affect numbers held  in  the  XACT-16C
  1195.      registers.  For example:
  1196.  
  1197.      Keystroke                 Display        Comment
  1198.      ================================================================
  1199.      [Dec]
  1200.      16 [Wsize]                               16 bit word size
  1201.      [2's] [Hex]                              2's compl, hex
  1202.      4E20 [ENTER]              4E20 Hex
  1203.      8 [Wsize]                   20 Hex       8 bits word size
  1204.  
  1205.  
  1206.      Notice when the  display  was  set  to  8 bits, the number in the
  1207.      display was truncated to 8 bits.
  1208.  
  1209.  
  1210.  
  1211.      5.14 "SHOW" Functions
  1212.  
  1213.      XACT-16C will display a  number  in a different radix for about 2
  1214.      seconds,  then revert  back  to  the  current radix, whenever the
  1215.      [Show]  function  key,  immediately  above  that  radix  key,  is
  1216.      pressed.   For instance, say you have  pressed  [Bin]  to  select
  1217.      binary as your default radix.  You may view a  number temporarily
  1218.      in hex by pressing the [Show] key immediately above the [Hex] key
  1219.      (press the left shift key, then press the letter 'e').
  1220.  
  1221.  
  1222.  
  1223.      5.15 Display Windows
  1224.  
  1225.      In  decimal  mode,  XACT-16C  can  show  up  to  8 digits on it's
  1226.      display.  Since XACT-16C is capable of word sizes up to  64 bits,
  1227.      in  some cases, not all the digits can be shown on the display at
  1228.      a time.  For example:
  1229.  
  1230.      Keystroke                 Display        Comment
  1231.      ================================================================
  1232.      [Hex]
  1233.      10 [Wsize]                               16 bit word
  1234.      7B2 [Bin]            <- 10110010 Bin     More digits left
  1235.      [Wndo] 1                111 ->   Bin     Leftmost 8 bits.
  1236.      [Wndo] 0             <- 10110010 Bin     Reset window
  1237.  
  1238.  
  1239.      The number 7B2 Hex (11110110010 Bin) cannot be displayed within 8
  1240.      digits.  Only the lower order 8 bits are displayed.  The [Wndo] 1
  1241.      key sequence sets the display window to the next higher   order 8
  1242.      bits, bits 7 through 15.  Likewise, [Wndo]  2  would  be  used to
  1243.      display bits 8 through 23 and  so  on.   In  the current example,
  1244.      the number 7B2 is an 11 bit number. Setting [Wndo] 2 would show a
  1245.      blank display.
  1246.  
  1247.  
  1248.  
  1249.  
  1250.                                    - 22 -
  1251.      Windows  may  also  be "scrolled" one digit at a time.  To scroll
  1252.      the   window  one  digit  to the right press [>>].  To scroll the
  1253.      digit to the left, press [<<]. Window scrolling is reset  back to
  1254.      window 0 whenever an  operation key affecting the value displayed
  1255.      is pressed.
  1256.  
  1257.  
  1258.  
  1259.      5.16 Flags
  1260.  
  1261.      XACT-16C  incorporates 6 built in "flags" which  may  be  set  or
  1262.      cleared  under either program control, or as  the  result  of  an
  1263.      operation, or both.  The flags  are  numbered 0 through 5.  Flags
  1264.      are active in integer mode.
  1265.  
  1266.      The first 3  flags,  0  through  2, are used in programming only.
  1267.      These flags can be  set,  cleared,  and  tested within a program.
  1268.      These  flags  are  discussed  in  detail  in  the  section  under
  1269.      Programming.
  1270.  
  1271.      Flag 3 is used to control the display of leading zeros in integer
  1272.      mode.  When  set,  a  number  in  the display will be padded with
  1273.      leading zeros (leading zeros will not be displayed when the [Dec]
  1274.      radix is used).  To set flag3:
  1275.  
  1276.      Keystroke                 Display        Comment
  1277.      ================================================================
  1278.      [Hex]
  1279.      10 [Wsize]                               16 bit word, hex
  1280.      3A [ENTER]                3A Hex
  1281.      [SF] 3                  003A Hex         Set flag 3
  1282.      [CF] 3                    3A Hex         Clear flag 3
  1283.  
  1284.  
  1285.      Flag 4 is  also  known as the Carry (C) flag.  It is set when the
  1286.      result of an  algebraic  or bit manipulation function generates a
  1287.      carry.    When  performing a subtraction, a  carry  is  generated
  1288.      whenever there is a borrow in the most significant bit.
  1289.  
  1290.      Keystroke                 Display        Comment
  1291.      ================================================================
  1292.      [Hex]
  1293.      10 [Wsize] [2's]
  1294.      FF80 [ENTER]              FF80 Hex       (-128 Decimal)
  1295.      100  [ + ]                  80 Hex C     Carry generated
  1296.      1 [ + ]                     81 Hex       No carry
  1297.  
  1298.  
  1299.      Flag 5 is  also  known as the Overflow (G) flag.  It is set by an
  1300.      arithmetic operation which  would  result in a value which cannot
  1301.      be shown with the current word size and/or complement mode.  When
  1302.      Flag 5 is set, the letter 'G' appears in the  display, indicating
  1303.      an overflow.  For example:
  1304.  
  1305.  
  1306.  
  1307.                                    - 23 -
  1308.      Keystroke                 Display        Comment
  1309.      ================================================================
  1310.      [Dec]
  1311.      16 [Wsize] [2's]
  1312.      32767 [ENTER]             32767 Dec
  1313.      16384 [ + ]              -16385 Dec G
  1314.  
  1315.  
  1316.      In the above example, the result created an overflow and  the 'G'
  1317.      flag (overflow) was displayed.
  1318.  
  1319.  
  1320.  
  1321.      5.17 Status
  1322.  
  1323.      Pressing the [Stat] function key temporarily  alters  the display
  1324.      to show the  current  complement  mode,  word  size  and  flags 0
  1325.      through 3. When [Stat] is pressed, the display appears similar to
  1326.      the following:
  1327.  
  1328.                2-16-0000
  1329.  
  1330.      The value above indicates 2's  complement mode, 16 bit word size,
  1331.      and flags 3,2,1,0 are all cleared.
  1332.  
  1333.      The first number, shown before the dash, indicates the complement
  1334.      mode.   It is either 0, 1, or 2, for unsigned, 1's complement, or
  1335.      2's   complement respectively.  The  next  number  indicates  the
  1336.      current word  size in bits.  It may range from 1 to 64.  The last
  1337.      4  digits indicate  the status of flags 3,2,1,0 in that order.  A
  1338.      value of 1 indicates  the flag is set, 0 indicates it is cleared.
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.                                    - 24 -
  1365.      6. Arithmetic, Bit Manipulation, and Logical Functions
  1366.  
  1367.  
  1368.  
  1369.      6.1 Addition and Subtraction
  1370.  
  1371.      XACT-16C can perform the operations of  addition  and subtraction
  1372.      using  decimal,  hex,  binary,  and  octal radix types as well as
  1373.      floating point mode.  For example, to add the  numbers  3c0  hex,
  1374.      and 126 octal, and  then  subtract  35 decimal, (assuming STATUS=
  1375.      2-16-0000):
  1376.  
  1377.      Keystroke                 Display        Comment
  1378.      ================================================================
  1379.      [Hex]
  1380.      3C0 [ENTER]               3C0 Hex
  1381.      [Oct]                    1700 Oct
  1382.      126 [ + ]                2026 Oct
  1383.      [Dec]                    1046 Dec
  1384.      35 [ - ]                 1011 Dec
  1385.  
  1386.  
  1387.      The  result  is  1011 (decimal).  The carry flag will be set when
  1388.      the  addition  of  2  numbers  generates  a carry out of the most
  1389.      significant bit, or when the subtraction of 2 numbers generates a
  1390.      borrow from the most significant bit.
  1391.  
  1392.  
  1393.  
  1394.      6.2 Multiplication and Division
  1395.  
  1396.      Multiplication and division operations can  be  performed  in any
  1397.      available  radix.    Results of these operations may set or clear
  1398.      flag  4 (carry) and flag 5 (overflow) just  as  in  addition  and
  1399.      subtraction (except that multiplication does not affect  flag 4).
  1400.      In a division operation, only the integer portion  of  the result
  1401.      is returned, the decimal point part is truncated.  Flag 4 (carry)
  1402.      will  be  set  if the result  of  the  division  has  a  non-zero
  1403.      remainder.
  1404.  
  1405.      Keystroke                 Display        Comment
  1406.      ================================================================
  1407.      [Dec]
  1408.      12 [ENTER]                12 Dec         12 in X register
  1409.      4 [ * ]                   48 Dec         Multiply 12 * 4
  1410.      5 [ / ]                    9 Dec C       C Indicates remainder
  1411.  
  1412.  
  1413.  
  1414.      6.3 Remainder after Division
  1415.  
  1416.      To compute the remainder after division, (also known  as  the mod
  1417.      function), use the [RMD] function key.  The [RMD] key  will yield
  1418.      the result of the Y register mod the X register  with the sign of
  1419.  
  1420.  
  1421.                                    - 25 -
  1422.      the result set  to  be the same as the sign of X.  In the example
  1423.      below, assume STATUS= 2-16-0000.
  1424.  
  1425.      Keystroke                 Display        Comment
  1426.      ================================================================
  1427.      [Dec]
  1428.      52 [ENTER]                52 Dec         52 in Y register
  1429.      7 [RMD]                    3 Dec         Remainder
  1430.  
  1431.  
  1432.  
  1433.      6.4 Square Root
  1434.  
  1435.      The  [sqrtx]  function  can be used in either decimal or floating
  1436.      point mode.  In  decimal  mode, the fractional part of the result
  1437.      is truncated just as it is in division.  Likewise, flag 4 (carry)
  1438.      will be set if the fractional part of  the  square  root  is non-
  1439.      zero.  Assuming STATUS=  2-16-0000:
  1440.  
  1441.      Keystroke                 Display        Comment
  1442.      ================================================================
  1443.      [Dec]
  1444.      26 [sqrtx]                5 Dec C
  1445.  
  1446.  
  1447.      The carry flag indicates that a fractional part exists.
  1448.  
  1449.  
  1450.  
  1451.      6.5 Absolute Value
  1452.  
  1453.      This function will take the absolute  value  of a number in the X
  1454.      register  when the [Abs] key is pressed.  In unsigned  mode, this
  1455.      function has no effect.  Otherwise, a negative  number  will form
  1456.      the 1's or 2's complement of the number.
  1457.  
  1458.  
  1459.  
  1460.      6.6 Logical Functions
  1461.  
  1462.      The  [AND]  function  logically  and's together the corresponding
  1463.      bits in the X and Y registers  and  forms  the  result  in  the X
  1464.      register.  A particular bit of the result is set to 1 only if the
  1465.      corresponding  bits  in  both the X and Y registers was set to 1.
  1466.      For example (assume  STATUS= 2-16-0000):
  1467.  
  1468.      Keystroke                 Display        Comment
  1469.      ================================================================
  1470.      [Bin]
  1471.      1010 [ENTER]              1010 Bin
  1472.      11 [AND]                    10 Bin       Result of "and"
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.                                    - 26 -
  1479.      The [OR] function forms a result by or'ing together corresponding
  1480.      bits in the  X  and Y registers.  A bit in the result will be set
  1481.      to   1 if a corresponding bit in either the X or the Y  registers
  1482.      is set  to 1.  In the example below, assume STATUS= 2-16-0000:
  1483.  
  1484.      Keystroke                 Display        Comment
  1485.      ================================================================
  1486.      [Bin]
  1487.      1001 [ENTER]              1001 Bin
  1488.      11 [OR]                   1011 Bin       Result of OR
  1489.  
  1490.  
  1491.      With the [XOR] (Exclusive OR) function, a bit in  the  result  is
  1492.      set to 1 if either a corresponding bit in the X register or the Y
  1493.      register,  but  not  both, is set to 1.  In  the  example  below,
  1494.      assume STATUS= 2-16-0000:
  1495.  
  1496.      Keystroke                 Display        Comment
  1497.      ================================================================
  1498.      [Bin]
  1499.      1001 [ENTER]              1001 Bin
  1500.      11 [XOR]                  1010 Bin       Result of XOR
  1501.  
  1502.  
  1503.      The [Not] function complements all the bits of the value in the X
  1504.      register.    This  is equivalent to forming the 1's complement of
  1505.      the  number.  In the example below, assume  STATUS= 2-16-0000:
  1506.  
  1507.      Keystroke                 Display        Comment
  1508.      ================================================================
  1509.      [Hex] 9                   9 Hex
  1510.      [Not]                  FFF6 Hex          Result of NOT
  1511.  
  1512.  
  1513.  
  1514.      6.7 Bit Functions
  1515.  
  1516.      A specific bit can be set (1) or cleared (0) within a number.  To
  1517.      set a bit, the [SB] function key is used.   The  [CB] function is
  1518.      used to clear a bit.  A bit can also be tested   to  see  if it's
  1519.      set or cleared  with  the    [B?]  function.  (See the section on
  1520.      Programming for more information  on testing bits).  When setting
  1521.      or clearing a bit, the number in which the bit is to be set, must
  1522.      be in the Y register and the bit number in the  X  register.   In
  1523.      the example below, assume STATUS= 2-16-0000:
  1524.  
  1525.      Keystroke                 Display        Comment
  1526.      ================================================================
  1527.      [Bin]
  1528.      10000 [ENTER]             100000 Bin     100000 in Y register
  1529.      10 [SB]                    10100 Bin     Set bit 2
  1530.  
  1531.  
  1532.      To clear a bit in a number:
  1533.  
  1534.  
  1535.                                    - 27 -
  1536.      Keystroke                 Display        Comment
  1537.      ================================================================
  1538.      [Hex]
  1539.      FFFF [ENTER]              FFFF Hex       FFFF in Y register
  1540.      4 [CB]                    FFEF Hex       Clear bit 4
  1541.  
  1542.  
  1543.      6.8 Summing Bits
  1544.  
  1545.      The number of bits in a word  can  be  found  by  using  the [#B]
  1546.      function.  This function takes a number in the  X  register,  and
  1547.      returns the number of '1' bits, also in the X  register.   In the
  1548.      example below, assume STATUS= 2-16-0000:
  1549.  
  1550.      Keystroke                 Display        Comment
  1551.      ================================================================
  1552.      [Bin] 1101                1101 Bin
  1553.      [#B]                        11 Bin
  1554.      [DEC]                        3 Dec       3 bits were set
  1555.  
  1556.  
  1557.      6.9 Masking
  1558.  
  1559.      The mask functions form a mask of '1' bits in the X register. The
  1560.      number of '1' bits is set to the value in  the  X register before
  1561.      the  mask  function key was pressed.  A mask can be made as large
  1562.      as the  current word size.  The [MaskR] function  right justifies
  1563.      the mask and the [MaskL] function left justifies the  mask.    In
  1564.      the example below, assume STATUS= 2-16-0000:
  1565.  
  1566.      Keystroke                 Display        Comment
  1567.      ================================================================
  1568.      [Bin]
  1569.      100 [MaskR]               1111 Bin       Mask right
  1570.      [Hex]                        F Hex
  1571.      2 [MaskL]                 C000 Hex       Mask left
  1572.  
  1573.  
  1574.      6.10 Left Justify
  1575.  
  1576.      A word in  the  X  register  can be left-justified using the [LJ]
  1577.      function key.   This  operation returns the left justified number
  1578.      in the Y register.  The X register  contains  the  number  of '0'
  1579.      bits preceding the first '1' bit in the number before  being left
  1580.      justified.  In the example below, assume STATUS= 2-08-0000:
  1581.  
  1582.      Keystroke                 Display        Comment
  1583.      ================================================================
  1584.      [Bin]
  1585.      111 [LJ]                  101 Bin        5 leading zeros
  1586.      [R|]                 11100000 Bin        Roll Down stack
  1587.  
  1588.  
  1589.      Rolling down the stack shows the left justified number.
  1590.  
  1591.  
  1592.                                    - 28 -
  1593.      7. Shifting and Rotating Bits
  1594.  
  1595.  
  1596.      7.1 Shift Functions
  1597.  
  1598.      XACT-16C can  perform shift operations on numbers when in integer
  1599.      mode.  Shifts  can  be  either  logical or arithmetic.  A logical
  1600.      shift simply shifts bits left or right, bringing in  a  zero  bit
  1601.      from  the end.  An arithmetic shift is  similar  except  that  it
  1602.      preserves the sign bit  when  shifting.  Both types of shifts can
  1603.      shift into the carry, causing flag 4 (C)  to  be  set  or cleared
  1604.      accordingly.  In the examples below, assume STATUS=  2-08-0000:
  1605.  
  1606.      Keystroke                 Display        Comment
  1607.      ================================================================
  1608.      [Bin]
  1609.      1001 [SL]                 10010 Bin      Logical shift left
  1610.      01000000 [SL]          10000000 Bin      Logical shift left
  1611.      [SL]                          0 Bin C    Shift into carry.
  1612.      100000000 [ASR]        11000000 Bin      Brings in sign bit
  1613.  
  1614.  
  1615.      7.2 Rotate Functions
  1616.  
  1617.      Rotate  functions  are  like shift functions except  that  a  bit
  1618.      shifted out of  one end of a word is brought back in at the other
  1619.      end.  As in shifting, rotations can be either left or right using
  1620.      the [RL] or the [RR] functions.  Assume STATUS= 2-08-0000:
  1621.  
  1622.      Keystroke                 Display        Comment
  1623.      ================================================================
  1624.      10000010 [RL]             101 Bin C
  1625.  
  1626.      Rotations may also be made "through the carry".   The  [RRC]  and
  1627.      the [RLC] functions respectively shift  the low order or the high
  1628.      order bit into the carry.  The carry flag (flag 4) will be set if
  1629.      the bit rotating into the carry was a '1'.  The previous state of
  1630.      the carry flag will be brought back around at the other end.
  1631.  
  1632.      Keystroke                 Display        Comment
  1633.      ================================================================
  1634.      1 [RRC]                   0 Bin C        Rotates to carry
  1635.      [RRC]              10000000 Bin          Carry rotates
  1636.  
  1637.      Rotate operations may also rotate more than 1 bit at a  time with
  1638.      the  [RRn]  [RLn]  [RRCn]  and  [RLCn] functions.  Each of  these
  1639.      functions use the value in the  X register as a count of how many
  1640.      times to rotate the value in the Y register.    Assuming  STATUS=
  1641.      2-08-0000:
  1642.  
  1643.      Keystroke                 Display        Comment
  1644.      ================================================================
  1645.      1000 [ENTER]              1000 Bin
  1646.      100 [RLn]             10000000 Bin       Rotate 4 times
  1647.  
  1648.  
  1649.                                    - 29 -
  1650.      8. Floating Point Mode
  1651.  
  1652.  
  1653.  
  1654.      8.1 Converting to Floating Point Mode
  1655.  
  1656.      In addition to  integer  mode, XACT-16C also operates in floating
  1657.      point mode.    In  this  mode,  XACT-16C  acts much like a second
  1658.      "independent"  calculator.    Many  functions  operate  in either
  1659.      floating  point mode or integer mode,  for  example  the  [sqrtx]
  1660.      function.  However, unlike integer  mode, this function  will not
  1661.      truncate a result to an integer result, it will  return  a  value
  1662.      with up to 9 significant digits beyond the decimal point.
  1663.  
  1664.      To convert XACT-16C to floating point mode:
  1665.  
  1666.      Keystroke                 Display        Comment
  1667.      ================================================================
  1668.      [Float] 2                 0.00           2 dec pt digits
  1669.  
  1670.  
  1671.      You may press any number (using  the  numeric keypad) from 0 to 9
  1672.      after pressing the  [Float]  key.    The  number  you  press will
  1673.      determine  the  number  of  digits  past the decimal point to  be
  1674.      displayed.  For example:
  1675.  
  1676.      Keystroke                 Display        Comment
  1677.      ================================================================
  1678.      26 [sqrtx]                5.10           2 dec pt digits
  1679.      [Float] 5                 5.09902        5 dec pt digits
  1680.  
  1681.  
  1682.      Notice  that  when  using  2  digits  beyond  the decimal  point,
  1683.      XACT-16C will "round" the next digit into the number displayed.
  1684.  
  1685.  
  1686.  
  1687.      8.2 Floating Point Calculations
  1688.  
  1689.      Calculations in floating point mode work in the same  way  as  in
  1690.      integer  mode.  However, there are a  number  of  functions  that
  1691.      operate only in  integer  mode  and  some  that  operate  only in
  1692.      floating  point  mode.    Generally  speaking,  all  of  the  bit
  1693.      manipulation,  radix  conversion,  and  logical functions are not
  1694.      available in floating point mode.
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.                                    - 30 -
  1707.      The reciprocal function [1/x] and the exponent function [EEx] are
  1708.      only available in floating point mode.  To  illustrate  them, for
  1709.      example:
  1710.  
  1711.      Keystroke                 Display        Comment
  1712.      ================================================================
  1713.      [Float] 4                                4 dec pt digits
  1714.      12 [EEx] 3                12.  +03
  1715.      [ChS]                     12.  -03
  1716.      [ENTER]                    0.0120
  1717.      .001 [ - ]                 0.0110        Subtract
  1718.      [1/x]                     90.9091        Reciprocal
  1719.  
  1720.  
  1721.  
  1722.      8.3 Returning to Integer Mode
  1723.  
  1724.      To return to integer  mode,  press  any  of the following: [Hex],
  1725.      [Dec],  [Oct]  or [Bin].  You may  notice  that  the  same  value
  1726.      appears in the display as  before you converted to floating point
  1727.      mode.  In  fact,  all  the  memory  registers,  stack,  etc., are
  1728.      retained.
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.                                    - 31 -
  1764.      9. Programming XACT-16C
  1765.  
  1766.      9.1 Introduction to Programming
  1767.  
  1768.      XACT-16C may  be  programmed  to  "memorize"  keystrokes  for the
  1769.      purpose  of executing a program.  Programs may use  constructs of
  1770.      conventional   programming languages such as branching,  looping,
  1771.      data input and output,  etc.  The basics of  programming XACT-16C
  1772.      involve entering, editing,  debugging and finally  executing your
  1773.      program.
  1774.  
  1775.  
  1776.  
  1777.      9.2 Entering a Program
  1778.  
  1779.      To begin entering a new  program  into  XACT-16C,  the calculator
  1780.      must be placed in  program  mode  by  pressing the [P/R] function
  1781.      key.   When in program mode,  subsequent  keystrokes  are  simply
  1782.      stored in the calculator's internal memory. The [P/R] key toggles
  1783.      between program and run modes.
  1784.  
  1785.      Keystroke                 Display        Comment
  1786.      ================================================================
  1787.      [P/R]                     000-           Program mode
  1788.      [P/R]                     (as before)    Run mode
  1789.  
  1790.  
  1791.      The display shows 000-.  This represents the current program line
  1792.      number of the program you are  entering.   Line 000 is special in
  1793.      that    it  always represents the beginning  of  program  memory.
  1794.      Let's enter  a simple program:
  1795.  
  1796.      Keystroke                 Display        Comment
  1797.      ================================================================
  1798.      [P/R]
  1799.      [Prgm]                   000-            Clear pgm
  1800.      [Lbl] [ A ]              001- 43 22 A    Start pgm
  1801.      [Hex]                    002-      23
  1802.      3                        003-       3
  1803.      [ENTER]                  004-      36
  1804.      4                        005-       4
  1805.      [ + ]                    006-      10
  1806.      [RTN]                    007-   43 21    Last pgm line
  1807.      [P/R]                                    Run mode
  1808.  
  1809.  
  1810.      This program simply adds the numbers 3 and 4 then finishes.   The
  1811.      first keystroke, [P/R] puts XACT-16C in program mode.  The [Prgm]
  1812.      key clears any  programs  previously in memory. Skipping over the
  1813.      [Lbl] instruction for the  moment,  the  [Hex]  key is the second
  1814.      program line in  the  program.    In the  display, 002- indicates
  1815.      program  line  2  (there  are  a  maximum  of  203  program lines
  1816.      available).  Just  to  the  right  of  the program line is a code
  1817.      which  represents  which  key was pressed. The first digit of the
  1818.  
  1819.  
  1820.                                    - 32 -
  1821.      number indicates the row and the second indicates  the  column of
  1822.      where the key is positioned on the XACT-16C screen.  If you think
  1823.      of all the keystrokes on the calculator face as being in  a table
  1824.      with 4 rows and 10 columns, the [Hex] function key is  located in
  1825.      the 2nd row and  3rd  column, thus the program line displays 002-
  1826.      23.    Back  to the first line of the program,  it  contains  the
  1827.      keystrokes [Lbl] [  A ] to refer to that line as a label.  Labels
  1828.      are used in XACT-16C in much the same way as they are in assembly
  1829.      language or Basic programming.  Labels can be  locations  used to
  1830.      identify  the  start  of  a  program,  the  location  of  a  goto
  1831.      instruction,  or  the  location  to  call in a  subroutine  call.
  1832.      Programs  must  begin  with a label to identify where the program
  1833.      starts.  The program line  for our label reads 001-  43 22 A.  In
  1834.      this case, since the [Lbl] key requires a prefix, the position of
  1835.      the  prefix  key  is the first value shown to the  right  of  the
  1836.      program line number.  The number 43 indicates row  4,  column  3,
  1837.      which is the position of the [ g ] (or right shift) prefix key.
  1838.  
  1839.      The  last value displayed on program line 2  is  the  value  'A'.
  1840.      Notice that it is not referred  to by a  location  in the "table"
  1841.      of  XACT-16C function keys, but rather   by  it's  numeric  value
  1842.      itself.   All the numbers 0 through 9 and A through  F are  shown
  1843.      as their numeric values when in programming mode.
  1844.  
  1845.      Notice the use of the  [RTN]  function  key  at  the  end  of the
  1846.      program.    This  key  must  always  be  the  last entered, it is
  1847.      required to end the program.    In  the  very  last  line  of the
  1848.      program,  you will notice the [P/R] key.  It is used to exit from
  1849.      program mode so that we can  run the program.
  1850.  
  1851.      Now we have our program contained in memory,  we  can  run  it by
  1852.      typing:
  1853.  
  1854.      Keystroke                 Display        Comment
  1855.      ================================================================
  1856.      [GSB] [ A ]               7 Hex          Result
  1857.  
  1858.  
  1859.      The [GSB] (goto subroutine) function key is used to begin program
  1860.      execution at the  first  instruction in the program following the
  1861.      label,   in this case the label was A.  The [GSB] instruction can
  1862.      also  be  used  within  a  program,  to  perform   a  call  to  a
  1863.      subroutine.
  1864.  
  1865.  
  1866.  
  1867.      9.3 Labels in Programs
  1868.  
  1869.      There are 16 labels  available  in programming, 0-9 and A-F.  The
  1870.      previous  example used a label to identify  the  beginning  of  a
  1871.      program.   In general, a label is always  necessary  to  begin  a
  1872.      program.    Labels  are also used  as  targets  of  [GTO]  (goto)
  1873.      instructions and [GSB] (goto  subroutine)  instructions.   Labels
  1874.      can  also  be  used to separate  programs  from  one  another  in
  1875.  
  1876.  
  1877.                                    - 33 -
  1878.      XACT-16C's program  memory; as a way of keeping multiple programs
  1879.      in memory at one time (although this is  generally  not necessary
  1880.      since programs can be loaded as disk  files).
  1881.  
  1882.  
  1883.  
  1884.      9.4 Using Subroutines
  1885.  
  1886.      A program can call a subroutine from within the program  when the
  1887.      [GSB] instruction is used within  the program.  For instance, the
  1888.      instruction  [GSB]  5  will  transfer  control  to   the  program
  1889.      instruction  immediately    following  the  instruction  [Lbl]  5
  1890.      contained elsewhere within the program.  Control will transfer to
  1891.      the label that identifies the subroutine. Subroutines can "nest",
  1892.      that is one subroutine may call another which may call   another,
  1893.      and so on.  The maximum level of subroutine nesting is 4.
  1894.  
  1895.  
  1896.  
  1897.      9.5 Returning from a Program or Subroutine
  1898.  
  1899.      The last instruction in a program  must  always be a [RTN].  This
  1900.      tells the program to reset it's  program  line number  to 000 (go
  1901.      back to  the beginning) and stop executing. The [RTN] instruction
  1902.      is  also the last instruction in a subroutine.    In  this  case,
  1903.      after  the  execution  of  the  [RTN]  instruction,   control  is
  1904.      transferred back to the  instruction    following  the subroutine
  1905.      call.
  1906.  
  1907.  
  1908.  
  1909.      9.6 Entering Data and the Run/Stop Key
  1910.  
  1911.      There  are  generally  2 ways to get data into a  program.    The
  1912.      easiest  is  to  use  the  [Sto]  instruction  to store  data  in
  1913.      registers prior to running  the  program.    Then the program can
  1914.      contain [Rcl] instructions  to  fetch the data from the register.
  1915.      The second method is required when there is more data to be input
  1916.      than available storage registers.    It  involves using the [R/S]
  1917.      (run/stop) function key.  When  this  key  is  encountered during
  1918.      program execution, the program  stops.    At  this point, you can
  1919.      enter  new  data  and then press the [R/S] key.  The program will
  1920.      begin running again.
  1921.  
  1922.      For  example,  let's  write  a  program which will  accept  input
  1923.      numbers, one at a  time,  and "exclusive or" each number with the
  1924.      number  3A9 Hex.  The program will  display  the  exclusive  or'd
  1925.      result after each input.
  1926.  
  1927.      Keystroke                 Display        Comment
  1928.      ================================================================
  1929.      [P/R]
  1930.      [Prgm]                                   Clear program memory
  1931.      [Lbl] 1               001-  43  22  1
  1932.  
  1933.  
  1934.                                    - 34 -
  1935.      [Hex]                 002-         23
  1936.      1                     003-          1
  1937.      0                     004-          0
  1938.      [WSIZE]               005-     42  44
  1939.      0                     006-          0
  1940.      [ENTER]               007-         36
  1941.      [Lbl] 2               008-  43  22  2
  1942.      [R/S]                 009-         31
  1943.      [ENTER]               010-         36
  1944.      3                     011-          3
  1945.      A                     012-          A
  1946.      9                     013-          9
  1947.      [x<>y]                014-         34
  1948.      [XOR]                 015-     42  10
  1949.      [GTO] 2               016-     22   2
  1950.      [RTN]                 017-     43  21
  1951.      [P/R]                                    Return to RUN mode
  1952.  
  1953.  
  1954.      To execute the program:
  1955.  
  1956.      Keystroke                 Display        Comment
  1957.      ================================================================
  1958.      [Gsb] 1                   0            Wait for input data
  1959.      1 [R/S]                 3A8 Hex        Result of 3a9 xor 1
  1960.      F [R/S]                 3A6 Hex        Result of 3a9 xor F Hex
  1961.      20 [R/S]                389 Hex        Result of 3a9 xor 20 Hex
  1962.  
  1963.  
  1964.  
  1965.      9.7 Branching Using the Index Register
  1966.  
  1967.      In the previous example, we used a [Gto] instruction to branch to
  1968.      a label, in this  case,  label 2.  As previously mentioned, there
  1969.      are 16 available labels, 0-9 and A-F.  You can also use the index
  1970.      register [I] to indirectly branch  to a label, or indirectly call
  1971.      a subroutine.  If the [I] register contains a number representing
  1972.      a label, the instructions [GTO] [I] and [GSB] [I] will indirectly
  1973.      branch to a label or indirectly call a  subroutine.
  1974.  
  1975.  
  1976.  
  1977.      9.8 Program Loops Using the Index Register
  1978.  
  1979.      XACT-16C   contains  2  instructions  that  first  increment   or
  1980.      decrement  the  index  register and skip the next program line if
  1981.      the  index  register  is  zero.    These  instructions are  [Isz]
  1982.      (increment  and  skip  if zero), and [Dsz] (decrement and skip if
  1983.      zero).  They can be used to control  loops  where  the  number of
  1984.      times to execute the  loop  is  contained  in the index register.
  1985.      For  example,   a  program  fragment  may  look  similar  to  the
  1986.      following:
  1987.  
  1988.  
  1989.  
  1990.  
  1991.                                    - 35 -
  1992.         5 [STO] [ I ]
  1993.         [LBL] [ B ]
  1994.  
  1995.      (instructions within loop)
  1996.  
  1997.         [DSZ]
  1998.         [GTO] [ B ]
  1999.         [RTN]
  2000.  
  2001.      In this case, the instruction within the loop  between  the [Lbl]
  2002.      [B] program line and the [Gto] [B] program line will  be executed
  2003.      5 times.  After the 5th  time,  the index register will contain 0
  2004.      and the [Gto]  [B]    instruction  will be skipped.  Instead, the
  2005.      [Rtn] instruction will be executed.
  2006.  
  2007.  
  2008.  
  2009.      9.9 Program Loops and Branches Using the X and Y Registers
  2010.  
  2011.      XACT-16C can also  make  "conditional  tests"  based  upon values
  2012.      contained  in  the X and Y registers.    There  are  8  different
  2013.      possible conditions in all.   These  functions  each  execute the
  2014.      next instruction in the  program  if  the  condition is true, and
  2015.      skip over it  if  the  condition  is false.  The instructions are
  2016.      defined as
  2017.  
  2018.  
  2019.         [x<=y]   true if x less than or equal to y
  2020.         [x<0]    true if x less than 0
  2021.         [x>y]    true if x greater than y
  2022.         [x>0]    true if x greater than 0
  2023.         [x<>y]   true if x not equal to y
  2024.         [x<>0]   true if x not equal to 0
  2025.         [x=y]    true if y equal to y
  2026.         [x=0]    true if x equal to 0
  2027.  
  2028.  
  2029.  
  2030.      9.10 Branching Using Flags
  2031.  
  2032.      The [F?] (text flag) function can be used to branch based  on the
  2033.      status of the flags.  There are a total of  6  flags in XACT-16C,
  2034.      identified    as  flags  0-5.    The  first  3  flags  (0-2)  are
  2035.      programmable general purpose   flags.   Flag 3 is used to display
  2036.      leading  zeros. Flag 4 is the Carry  (C) flag, and Flag 5 is  the
  2037.      overflow (G) flag.  Any of the  flags  may    be  used  in branch
  2038.      tests.  The  example  below   illustrates   a   program  fragment
  2039.      utilizing flags testing:
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.                                    - 36 -
  2049.  
  2050.  
  2051.         (Program instructions)
  2052.  
  2053.        [Lbl] 3
  2054.        [SF] 3
  2055.        [Gto] [ B ]
  2056.  
  2057.        (Program instructions)
  2058.  
  2059.         [Lbl] 4
  2060.         [CF] 0
  2061.         [Gto] [ B ]
  2062.  
  2063.         (Program instructions)
  2064.  
  2065.  
  2066.         [Lbl] [ B ]
  2067.         [F?] 0          (test to see if flag 0 is set)
  2068.         [Gto] [ C ]     (transfer control to label C if flag 0 set)
  2069.         [Gto] [ D ]     (transfer control to label D if flag 0 clear)
  2070.  
  2071.      If  the program executes at label 3, flag 0 is set and control is
  2072.      transferred to label B.  At this point,  since  flag  0  was set,
  2073.      control  will  transfer  to  label  C.  Likewise, if the  program
  2074.      executes at label 4, flag 0    is cleared, and thus, when control
  2075.      is  transferred  to  label B, the flag test will fail.  This will
  2076.      cause the [Gto] [ D ] instruction to be executed.
  2077.  
  2078.  
  2079.  
  2080.      9.11 Branching On Bit Set/Clear
  2081.  
  2082.      Programs can branch on the status of a specific bit set  or clear
  2083.      using the [B?] function.  This function operates similarly to the
  2084.      [F?] function.
  2085.  
  2086.  
  2087.  
  2088.      9.12 The Single-Step Instruction
  2089.  
  2090.      The [SSt] (single-step) instruction can be used in either program
  2091.      mode or run mode.    In program mode, pressing [SSt] will display
  2092.      the next program  line  number  in  a  program.  In run mode, the
  2093.      [SSt] function can be used to execute a  program  one  step  at a
  2094.      time.  This is useful for program debugging.   The  [BSt]  (back-
  2095.      step) instruction works like  the  [SSt]  instruction  in program
  2096.      mode except that it displays  the previous program line number in
  2097.      a program.  The [Bst] instruction does not operate in run mode.
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.                                    - 37 -
  2106.      9.13 Moving to a Program Line Number
  2107.  
  2108.      You can move to a specific line number in either program  mode or
  2109.      run mode.  Press [Gto] [ . ] nnn  where nnn is a  3  digit number
  2110.      between  0  and 203.  In run  mode,  pressing  [R/S]  will  begin
  2111.      execution at that line number.
  2112.  
  2113.  
  2114.  
  2115.      10 Appendix
  2116.  
  2117.  
  2118.      10.1 Error Conditions
  2119.  
  2120.      When an error  is  encountered  during  operation,  XACT-16C will
  2121.      display  the  word  "Error" in the calculator's display, followed
  2122.      by a 1 digit  error code.  These error codes are defined below:
  2123.  
  2124.  
  2125.      Error 0  -  Invalid math operation.  This  error  is  encountered
  2126.      when  an  operation  attempted division by 0 or square  root of a
  2127.      negative number.
  2128.  
  2129.      Error 1 - Invalid identifier.  A flag, window,  or  program  line
  2130.      number was out of range.
  2131.  
  2132.      Error  2  -  Invalid  Bit  Number.  This happens when  operations
  2133.      attempt to set bits, mask bits, or rotate  multiple  bits greater
  2134.      than the current word size.
  2135.  
  2136.      Error 3 -  Invalid  Register.    An  attempt was made to access a
  2137.      label or line number that is out of range.
  2138.  
  2139.      Error 4 - Invalid label or line number.  An  attempt  was made to
  2140.      access a label or line number that is out of range.
  2141.  
  2142.      Error  5  -  Invalid subroutine nesting.  A subroutine was nested
  2143.      more than 4 levels deep.
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.                                    - 38 -